# -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
import views
import settings
admin.autodiscover()

from DjangoUeditor import urls as djud_urls
urlpatterns = patterns('',
                       (r'^%s(?P<path>.*)$'%settings.STATIC_URL[1:],'django.views.static.serve',
                       {'document_root': settings.STATIC_ROOT}),
                    # (r'^%s(?P<path>.*)$'%settings.MEDIA_URL[1:],'django.views.static.serve',
                    # {'document_root': settings.MEDIA_ROOT[0]}),

    # url(r'^static/(?P<path>.*)$', 'django.views.static.serve',
    # {'document_root': settings.STATICFILES_DIRS[0]}),

    (r"^comment/", include('comment.urls',namespace='comment')),  # 评论模块
    url(r'^admin/', include(admin.site.urls)),   # 管理后台
    url(r'^ueditor/', include(djud_urls)),       # 富文本
    url(r"^$", views.index),                     # 首页
    url(r'^cate_list/(?P<category_id>\d+)/$', views.cate_list),  # 分类列表
    url(r'^detail/(?P<hid>\d+)/$', views.detail),
    url(r'^cat_title/', views.cat_title),

    url(r'^post/', views.post),
    url(r'^article_like/', views.article_like),
    url(r'^digg/', views.digg),
    url(r'^time_(.*)/$', views.time_handle),
    url(r'^about/$', views.about_me),
    (r"^e07413354875be01.txt ", views.txt),

)

if settings.DEBUG:
    from django.conf.urls.static import static
    urlpatterns += static(settings.MEDIA_URL,document_root = settings.MEDIA_ROOT)